package com.itheima.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @Author：shenkunlin
 * @date： 2021/7/15 12:03
 * @Description：
 ***/
@Data
@NoArgsConstructor
@AllArgsConstructor
/***
 * 1:index  @Document
 * 2:type   _doc[淘汰]
 * 3:Filed  @Field
 *      mapping:searchAnalyzer / analyzer / index=true / type=FiledType.Text..
 */
@Document(indexName = "blog")
public class Article implements Serializable {
    @Id
    private Long id;
    @Field(searchAnalyzer ="ik_max_word",analyzer = "ik_max_word",type = FieldType.Text)
    private String title;
    @Field(searchAnalyzer ="ik_max_word",analyzer = "ik_max_word",type = FieldType.Text)
    private String content;
}
